package com.mahu.googleplay.base;

import android.app.Activity;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.v7.app.AppCompatActivity;

/**
 * Created by Tiger on 2016/10/23.
 */
public abstract class BaseActivity extends AppCompatActivity  {
    private static Activity mForegroundActivity = null;

    public static Activity getForegroundActivity() {
        return mForegroundActivity;
    }

    @Override
    public void onCreate(Bundle savedInstanceState, PersistableBundle persistentState) {
        super.onCreate(savedInstanceState, persistentState);
        init();
        initView();
        initToolBar();


    }


    @Override
    protected void onResume() {
        super.onResume();
        this.mForegroundActivity = this;
    }

    @Override
    protected void onPause() {
        super.onPause();
        this.mForegroundActivity = null;
    }

    protected abstract void init();

    protected abstract void initView();

    protected abstract void initToolBar();

}
